package com.eastcom.dataquality.core.dao;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.support.JdbcDaoSupport;

import com.eastcom.dataquality.core.module.Atom_SmoothDefine;

public class SmoothDefineDao extends JdbcDaoSupport implements RowMapper<Atom_SmoothDefine>{

	public List<Atom_SmoothDefine> findAll(){
		String sql="select * from qa_smooth_define";
		List<Atom_SmoothDefine> results=getJdbcTemplate().query(sql,this);
		return results;
	}

	public Atom_SmoothDefine mapRow(ResultSet rs, int rowNum)
			throws SQLException {
		Atom_SmoothDefine smoothDefine=new Atom_SmoothDefine();
		smoothDefine.setId(rs.getString("id"));
		smoothDefine.setDataset_id(rs.getString("dataset_id"));
		smoothDefine.setEventType(rs.getInt("eventtype"));
		smoothDefine.setSmoothType(rs.getInt("smoothtype"));
		smoothDefine.setHandleType(rs.getInt("handletype"));
		smoothDefine.setKpiName(rs.getString("kpiName"));
		smoothDefine.setEnable(rs.getBoolean("enable"));
		smoothDefine.setProcessRange(rs.getInt("processrange"));
		smoothDefine.setStratege_id(rs.getString("stratege_id"));
		return smoothDefine;
	}
}
